package cn.java86.print;

/**
 * @author oldliu
 * @since 1.0
 */
//打印机
public class Printer {
    private String brand;//品牌
    private int price;
    //墨水
    private Ink ink;
    private TextPaper paper;
    public Printer(){
        System.out.println("打印机对象被创建了");
    }

    public Printer(String brand, int price, Ink ink, TextPaper paper) {
        this.brand = brand;
        this.price = price;
        this.ink = ink;
        this.paper = paper;
    }

    //初始化
    public void init(){
        System.out.println("打印机初始化完成");
    }
    public void xiaohui(){
        System.out.println("打印机被销毁了");
    }
    public void doPrint(String str){
        System.out.println("牌子是"+brand+"价格是"+price+"元的打印机开始工作了");
        System.out.println("使用"+ink.getColor()+"打印");
        paper.print(str);
    }

    public void setBrand(String brand) {
        this.brand = brand;
    }

    public void setPrice(int price) {
        this.price = price;
    }

    public void setInk(Ink ink) {
        this.ink = ink;
    }

    public void setPaper(TextPaper paper) {
        this.paper = paper;
    }
}
